package com.jn.algorithm.day001.question1;

import java.util.Arrays;

/**
 * @author 江南大学1033190417
 * @date 2022/4/15 10:03
 */
public class Solution {
    public int[] twoSum(int[] nums, int target) {
        for (int i = 0; i < nums.length-1; i++) {
            for (int j = i+1; j <nums.length ; j++) {
                if (nums[i]+nums[j]==target){
                    return new int[]{i,j};
                }
            }
        }
        return new int[0];
    }
    public static void main(String[] args) {
        Solution solution=new Solution();
        int[] nums=new int[]{3,2,4};
        int[] ints = solution.twoSum(nums, 6);
        System.out.println(Arrays.toString(ints));
    }
}
